
<?php
$tracker = Tracker::model()->find('dispatchno=:dispatchno', array(
        'dispatchno' => $model->dispatch
    )
);
if (!empty($tracker)) {
    $email = $tracker->email;
    $status = 1;
}
else {
    $email = '';
    $status = 0;
}
?>


<div class="form">
    <?php echo CHtml::form(); ?>
    <div class="row">
        <label>Email Tracker Status</label>

        <div class="data-model">
            <?php echo CHtml::dropDownList('status', $status, array(0 => 'Off', 1 => 'On')); ?>

        </div>

    </div>
    <div class="row">
        <label>Email</label>

        <div class="data-model">
            <?php echo CHtml::textField('email', $email, array('id' => 'email')); ?>

        </div>

    </div>

    <div class="row">
        <?php echo CHtml::submitButton('Save', array('id' => 'submitMail'))?>
    </div>
    <?php echo CHtml::endForm()?>
</div>
